package com.hht.touchlibs

import android.content.Context
import android.view.MotionEvent
import android.view.View


/**
 * Author:chen'hu
 * Time:2024/6/13 13:40
 * Description:This is ChildViewTouchEvent
 */
class ChildViewTouchEvent(mContext: Context, mCurView: View, mTouchEvent: UserTouchEvent) :
    UserTouchListener(mContext, mCurView, mTouchEvent) {
    override fun onScroll(
        e1: MotionEvent,
        e2: MotionEvent,
        distanceX: Float,
        distanceY: Float,
    ): Boolean {
        mCurrentX = (e2.rawX - mDownX - mView.left).toInt()
        mCurrentY = (e2.rawY - mDownY - mView.top).toInt()
        mUserTouchEvent.onTouchMove(mView, mCurrentX, mCurrentY);
        return true
    }
}